using System;
using System.Data;
using System.Configuration;
using System.Collections;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using System.Web.UI.WebControls.WebParts;
using System.Web.UI.HtmlControls;
using Web.Core.Objects;
using Web.Core;

public partial class AdminCP_Logs : System.Web.UI.Page
{
    protected void Page_Load(object sender, EventArgs e)
    {
        if (Session["Membership"] != null && !(Session["Membership"] as Member).IsAdministrator())
            Response.Redirect("Default.aspx");

        int page = 1;
        if (Request.Params["page"] != null)
            page = int.Parse(Request.Params["page"]);
        ArrayList arrLogs = Logs.GetLogByPage(page, 10);        
        if (!IsPostBack)
        {
            this.rptLogs.DataSource = arrLogs;
            this.rptLogs.DataBind();
        }
        // Pager
        this.Pager1.objectsPerPage = 10;
        this.Pager1.displayAll = false; // Chi hien thi ben phai
        this.Pager1.totalObjects = Logs.CountAllLogs();
        // ---------------
    }
}
